import request from '../utils/request'
export const getArticleList = params => {
    return request({
        // 如果是params默认get请求，如果data= params是post请求
        url: '/v1_0/articles',
        params
    })
}
export const getArticleDetail = id => {
    return request({
        // 如果是params默认get请求，如果data= params是post请求
        url: '/v1_0/articles/' + id,

    })
}

// 文章收藏
export const addArticleCollect = data => {
        return request({
            method: 'POST',
            url: '/v1_0/article/collections',
            data
        })
    }
    // 取消文章收藏
export const deleteArticleCollect = target => {
        return request({
            method: 'DELETE',
            url: '/v1_0/article/collections/' + target
        })
    }
    // 文章点赞
export const addArticleZan = data => {
        return request({
            method: 'POST',
            url: '/v1_0/article/likings',
            data
        })
    }
    // 取消文章点赞
export const deleteArticleZan = target => {
    return request({
        method: 'DELETE',
        url: '/v1_0/article/likings/' + target
    })
}